<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  <!-- 启用360浏览器的极速模式(webkit) -->
  <meta name="renderer" content="webkit">
  <!-- 避免IE使用兼容模式 -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
  <meta name="HandheldFriendly" content="true">
  <!-- 微软的老式浏览器 -->
  <meta name="MobileOptimized" content="320">
  <!-- uc强制竖屏 -->
  <meta name="screen-orientation" content="portrait">
  <!-- QQ强制竖屏 -->
  <meta name="x5-orientation" content="portrait">
  <!----禁止数字呼叫---->
  <meta name="format-detection" content="telephone=no"/>
  <link rel="stylesheet" href="style/reset_7043.css"/>
  <link rel="stylesheet" href="style/invting.css"/>
  <style>
    .y_fen {
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.8);
      position: fixed;
      z-index: 99999;
      display: none;
    }

    .y_fen_center {
      width: 100%;
      font-size: 0.4rem;
      height: 0.23rem;
      text-align: center;
      color: #fff;
      position: absolute;
      top: 50%;
      margin-top: -0.115rem;
    }

    .banner_img p {
      width: 98%;
      padding: 0 1%;
      box-sizing: border-box;
      font-size: 0.22rem;
      color: #781f1d;
      position: absolute;
      top: 3rem;
      left: 0.05rem;
      line-height: 0.5rem;
    }

    .banner_img h6 {
      width: 100%;
      text-align: center;
      font-size: 0.22rem;
      color: #781f1d;
      position: absolute;
      top: 7rem;
    }

    @media only screen and (min-width: 430px) and (max-width: 640px) {
      .text p {
        font-size: 0.35rem;
      }
    }

    #Qdu {
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      font-size: 0.3rem;
      text-align: center;
      position: fixed;
      top: 0;
      overflow: hidden;
      display: none;
    }

    #Qdu p {
      width: 3.5rem;
      height: 3.5rem;
      background: #fff;
      border-radius: 4px;
      position: absolute;
      top: 50%;
      left: 50%;
      margin-left: -1.75rem;
      margin-top: -1.75rem;
      line-height: 3.5rem;
    }
  </style>
  <title>邀好友赚现金奖励</title>
</head>

<body>
<!----悬浮---->
<div class="right_text">
  活动规则
</div>
<!----悬浮---->

<!--先加载提示窗口-->
<div class="index_banner">
  <div class="banner_img">
    <div class="gb"></div>
    <p>
      1、通过活动页面【邀请好友】按钮分享出去的注册链接邀请到的好友才有效。<br/>
      2、好友注册成功后首次投资金额不低于100(好友注册手机归属地需为浙江、湖南)。 <br/>
      3、好友首笔投资成功，邀请人即可获得5元现金奖励，越多好友投资，越多奖励金，上不封顶。<br/>
      4、如同一位好友多次投资，仅以首笔投资作为奖励，其他投资不再计算奖励。
    </p>
    <h6>本活动由鲸鱼平台保有最终解释权</h6>
    <div class="btn_banner"></div>
  </div>
</div>
<!--先加载提示窗口-->

<!--点击判断返回是否注册窗口-->
<div class="aleat_one">
  <div class="one_center">
    <a href="javascript:;">
      <div class="reg_banner"></div>
    </a>
  </div>
</div>
<!--点击判断返回是否注册窗口-->

<!--点击判断是否有投资记录窗口-->
<div class="investment investment_show">
  <div class="in_box">
    <div class="two_center">
      <div class="gb_1"></div>
      <!--<a href="http://192.168.10.45:8091/views/publicRegister/index.html">-->
      <div class="btn_banner1"></div>
      <!--</a>-->
    </div>
  </div>
</div>
<!--点击判断是否有投资记录窗口-->

<!---判断手机号码是否是正确的--->

<div class="iphone">
  <div class="iphone_center">
    <p>请输入手机号码！</p>
    <button class="iphone_btn">确定</button>
  </div>
</div>
<!---判断手机号码是否是正确的,然后分享--->
<div class="y_fen">
  <div class="y_fen_center">
    请点击右上角邀请好友
  </div>
</div>


<div class="container">
  <!--top-->
  <header>
    <img src="img/top_banner.jpg" width="100%" alt=""/>
    <span class="right_r"></span>
    <div class="text">
      <h2>仅限3天</h2>
      <p>已投资用户通过本页成功邀请好友注册并投资,每成功邀请一位好友即可获得5元现金奖励！<br/> 即时到账！多邀多得！上不封顶！
      </p>
    </div>
  </header>
  <!--top-->
  <div class="center">
    <img src="img/center.jpg" width="100%" alt=""/>
    <div class="text-one">
      <div class="text-list">
        <p>
          <span class="icon"></span>
          <span class="money">我累计获得奖励<span class="active">10</span>元</span>
        </p>
        <div class="border_botton"></div>
      </div>
      <ul class="ul">
        <li>
          <div class="tel">**7891</div>
          <div class="list_text">已成功邀请<span class="nunban">25</span>位好友</div>
          <div class="list_money">共获得<span>260</span>元</div>
        </li>
        <li>
          <div class="tel">**6841</div>
          <div class="list_text">已成功邀请<span class="nunban">27</span>位好友</div>
          <div class="list_money">共获得<span>300</span>元</div>
        </li>
        <li>
          <div class="tel">**6342</div>
          <div class="list_text">已成功邀请<span class="nunban">14</span>位好友</div>
          <div class="list_money">共获得<span>200</span>元</div>
        </li>
        <li>
          <div class="tel">**3512</div>
          <div class="list_text">已成功邀请<span class="nunban">28</span>位好友</div>
          <div class="list_money">共获得<span>250</span>元</div>
        </li>
        <li>
          <div class="tel">**2471</div>
          <div class="list_text">已成功邀请<span class="nunban">17</span>位好友</div>
          <div class="list_money">共获得<span>360</span>元</div>
        </li>
        <li>
          <div class="tel">**1351</div>
          <div class="list_text">已成功邀请<span class="nunban">55</span>位好友</div>
          <div class="list_money">共获得<span>280</span>元</div>
        </li>
        <li>
          <div class="tel">**3698</div>
          <div class="list_text">已成功邀请<span class="nunban">77</span>位好友</div>
          <div class="list_money">共获得<span>380</span>元</div>
        </li>
        <li>
          <div class="tel">**3541</div>
          <div class="list_text">已成功邀请<span class="nunban">57</span>位好友</div>
          <div class="list_money">共获得<span>260</span>元</div>
        </li>

      </ul>
    </div>
  </div>
  <div class="form">
    <input style="tel"
           maxlength="11"
           minlength="11"
           class="form_tel"
           placeholder="输入手机号码立即参与 "
           value=""
    />
    <span class="btn btn_submit" id="telClick"></span>
    <div style="height:1.5rem;width: 100%;" class="box_one"></div>
    <a class="btn btn_no " href="javascript:;" style="display: none;"></a>
    <p class="fenxain">抱歉，您还没有分享权限，需投资>100元</p>
  </div>
  <div class="false"></div>

  <!--固定底部-->
  <div class="fixed">
    <div class="btn btn_click"></div>
    <div class="hb"></div>
  </div>

</div>
<div class="pc">
  <p>请用手机打开</p>
</div>
<div id="Qdu">
  <p>您还未登录，请登录！</p>
</div>
</body>
<script type="text/javascript" src="build.js"></script>
<script type="text/javascript" src="javasctipt/jquery-1.11.0.js"></script>
<script type="text/javascript" src="javasctipt/scroll.js"></script>
<script type="text/javascript" src="javasctipt/flexble.js"></script>
<script type="text/javascript" src="javasctipt/jr.js"></script>
<script type="text/javascript" src='http://res.wx.qq.com/open/js/jweixin-1.0.0.js'></script>
<!--<script type="text/javascript" src='http://203.195.235.76/jssdk/js/zepto.min.js'></script>-->

<script>
  //设备检测
  function detectmob() {
    if (navigator.userAgent.match(/Android/i)
      || navigator.userAgent.match(/webOS/i)
      || navigator.userAgent.match(/iPhone/i)
      || navigator.userAgent.match(/iPad/i)
      || navigator.userAgent.match(/iPod/i)
      || navigator.userAgent.match(/BlackBerry/i)
      || navigator.userAgent.match(/Windows Phone/i)
    ) {
//                  window.location.href="index.html"  
    }
    else {
      $('.pc').show();
      return false
    }
  }
  detectmob()
</script>
<script>
  $(function () {
    FastClick.attach(document.body);
    if (document.documentElement.scrollHeight <= document.documentElement.clientHeight) {
      bodyTag = document.getElementsByTagName('body')[0];
      bodyTag.style.height = document.documentElement.clientWidth / screen.width * screen.height + 'px';
    }
    setInterval(function () {
      var newLi = $('.ul>:first').clone();
      $('.ul').append(newLi);
      $('.ul>:first').remove();
    }, 1000)
    $('.right_r').click(function () {
      $('.index_banner').show();
    })
    $('.right_text').click(function () {
      $(document).scrollTop(0)
      $('.index_banner').show();
      $('html,body').css({'overflow': 'hidden'});
    })
    //点击关闭
    $('.btn_banner,.gb').click(function () {
      $('.index_banner').hide();
      $('html,body').css({'overflow': 'visible'});
    })
    $('.iphone_btn').click(function () {
      $('.iphone').hide();
      $('html,body').css({'overflow': 'visible'});
    })
    $('.gb_1,.btn_banner1').click(function () {
      $('.investment').hide();
      $('html,body').css({'overflow': 'visible'});
    })
    //判断屏幕高度
    $(window).scroll(function () {
      if ($(window).scrollTop() < 220) {
        $(".fixed").show();
        $('.right_text').hide()
      } else if ($(window).scrollTop() > 220) {
        $(".fixed").hide();

        $('.right_text').show()
      }
    });
    //点击往下滑动
    $(".btn_click").click(function () {
      $("body").stop().animate({
        'scrollTop': "+=300px"
      }, 100)
    });

    // 获取url的参数
    function getRequest() {
      var url = location.search; //获取url中"?"符后的字串
      console.log(url);
      var theRequest = new Object();
      if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        var strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
          theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
      }
      return theRequest;
    }

    var data_this = getRequest().data;

    //	console.log(data_this)
    //获取首页数据
    $.ajax({
      type: "post",
      url: "/HbH5returncashzhejiang/getIndexData",
      async: true,
      error: function () {
        alert(404)
      },
      success: function (data) {
        var list = data.list;
        var myAccount = data.myAccount
        var str = '';
        for (var i = 0; i < list.length; i++) {
          str += ('<li><div class="tel">' + list[i].tel + '</div><div class="list_text">已成功邀请<span class="nunban">' + list[i].count + '</span>位好友</div><div class="list_money">共获得<span>' + list[i].total + '</span>元</div></li>')
          $('.ul').html(str)
        }
        var money = $('.money .active');
        money.text(myAccount)
      }
    });
    $.ajax({
      type: "post",
      data: {hb_key: data_this},
      url: "/HbH5returncashzhejiang/authorJudge",
      async: true,
      error: function () {
        alert(404)
      },
      success: function (data) {
        var money = $('.money .active');
        var code = data.code;
        if (code == 10000) {//判断是已经注册并且投资的用户可以分享
          console.log(data)
          money.text(data.myAccount);
          $('.btn_no,.box_one').show();
          $('.form_tel,.btn_submit').hide()
          $('html,body').css({'overflow': 'visible'})
          $('.btn_no').click(function () {
            "iOSAction::Share:xxxxxxxx&yyyyyyyyy&zzzzz"
            var key1 = "iOSAction";
            var key2 = "Share";
            var param1 = "xxxxxxxx";
            var value1 = 'zhejiangreturncash&fenxiang',
              param2 = "yyyyyyyyy",
              value2 = "2";
            var urlkind = key1 + "::" + key2 + ":" + value1;
            var url = urlkind;
            document.location = url;
          })
        } else if (code == 10001) {//判断是否登陆
//						$('#Qdu').show();
          $('html,body').css({'overflow': 'visible'});
          $('.btn_no').hide();
          $('.box_one').show();
          $('.form_tel,.btn_submit').hide();
          $('.fenxain').show();
//					    if(data_this=true){  
//					    	 $('#Qdu').show();
//					    	 $('.fenxain').hide();
//					    }else{
//					    	$('#Qdu').hide();
//					    	$('.fenxain').show();
//					    }
//					     if($(".fenxain").is(':hidden')){ 
//					      $('#Qdu').hide();
//					      $('.fenxain').show();
//					     }else{
//					     	 $('#Qdu').show();
//					     	  $('.fenxain').show();
//					     }
          isWeiXin();
          function isWeiXin() {
            var ua = window.navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == 'micromessenger') {
              $('.fenxain').hide();
              $('#Qdu').hide();
            }
//					    else if(data_this=false){
//					    	 $('#Qdu').show();
//					    }
            else {


            }

          }

        } else if (code == 10002) {
          $('.btn_no').show();
          console.log('错误');

        } else {
//						alert('sasa')
        }
        if (null != data_this && "" != data_this) {
          console.log(data_this)
        } else {
          $('.btn_no').hide();
          $('.btn_submit,.form_tel').show();
        }
      }
    });

    //点击邀请
    $('#telClick').click(function () {
      var telVue = $('.form_tel').val();
      if (telVue == '') {
        $('.iphone').show();
        $('html,body').css({'overflow': 'hidden'});
        return false;
      }
      var reg = /^1[34578]\d{9}$/;
      if (!reg.test($.trim(telVue))) {
        $('.iphone').show();
        $('.iphone_center p').text('手机号码格式不正确');
        $('html,body').css({'overflow': 'hidden'});
        return false;
      }

      $.ajax({
        type: "post",
        url: "/HbH5returncashzhejiang/authorJudge",
        async: true,
        data: {
          tel: telVue
        },
        success: function (data) {
          console.log(data);
          if (data.code == 10006) {//判断是否注册
            $('.aleat_one').show();
            $('html,body').css({'overflow': 'hidden'});
            $('.reg_banner').click(function () {
              //跳转到浙江注册页面
              window.location.href = "http://hbjr.jinrgame.com/webpack/dist/views/ZJRegister/index.html?province=zhejiang&tel=" + telVue
            })

          } else if (data.code == 10001) {//去应用市场下载app
            $('.investment_show').show();
            $('html,body').css({'overflow': 'hidden'});
            $('.btn_banner1').click(function () {
              //去投资
              window.location.href = "http://a.app.qq.com/o/simple.jsp?pkgname=com.jinr.core";
            })

          } else if (data.code == 10000) {//有权限，微信端可以分享
            var myAccount = data.myAccount;
            var money = $('.money .active');
            money.text(myAccount)
            $('.y_fen').show();
            $('html,body').css({'overflow': 'hidden'});
            $('.y_fen').click(function () {
              $(this).hide();
              $('html,body').css({'overflow': 'visible'});
            })
            var tel_fenxian = telVue.replace(/\d{7}(\d{4})/, '*******$1');
            var shareObj = { //
              debug: false,
              title: '您的好友' + tel_fenxian + '正在使用鲸鱼理财',
              appId: data.data.wx_info.appId,
              hb_key: data.data.wx_info.hb_key,
              jsapi_ticket: data.data.wx_info.jsapi_ticket,
              shareurl: data.data.wx_info.shareurl,
              url: data.data.wx_info.url,
//							    link:'http://hbjr.jinrgame.com/webpack/dist/views/ZJRegister/index.html?province=zhejiang&tel=14870561000',
              timestamp: data.data.wx_info.timestamp,
              nonceStr: data.data.wx_info.nonceStr,
              signature: data.data.wx_info.signature,
              desc: tel_fenxian + '邀请您立即加入致富小分队，现在加入还有￥5000收益金！',
              imgUrl: 'http://hbjr.jinrgame.com/src/HbH5returncashzhejiang/img/ldx_share.jpg',
              jsApiList: [
                // 所有要调用的 API 都要加到这个列表中
                'checkJsApi',
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'onMenuShareQQ',
                'onMenuShareWeibo',
                'onMenuShareQZone'
              ]
            }
//							   console.log(shareObj.link)
            wx.config({
              debug: false,
              appId: shareObj.appId,
              jsapi_ticket: shareObj.jsapi_ticket,
              timestamp: shareObj.timestamp,
              nonceStr: shareObj.nonceStr,
              signature: shareObj.signature,
              jsApiList: shareObj.jsApiList
            });
            //完成wx.config，执行这里
            wx.ready(function () {

              //分享到朋友圈
              wx.onMenuShareTimeline({
                title: shareObj.title, //
                desc: shareObj.desc, // 描述
                link: 'http://hbjr.jinrgame.com/webpack/dist/views/ZJRegister/index.html?province=zhejiang&tel=14870561000', // 链接
                imgUrl: shareObj.imgUrl,
                success: function (res) {
                  alert('success')
                },
                cancel: function (res) {
                }
              });
              //分享到好友
              wx.onMenuShareAppMessage({
                title: shareObj.title, // 标题
                desc: shareObj.desc, // 描述
                link: 'http://hbjr.jinrgame.com/webpack/dist/views/ZJRegister/index.html?province=zhejiang&tel=14870561000', // 链接
                imgUrl: shareObj.imgUrl,
                success: function (res) {
                  // 分享成功执行此回调函数
                  alert('已分享');
                },
                cancel: function (res) {
                  alert('已取消');
                }
              });        //
              wx.onMenuShareQQ({
                title: shareObj.title,
                desc: shareObj.desc,
                link: 'http://hbjr.jinrgame.com/webpack/dist/views/ZJRegister/index.html?province=zhejiang&tel=14870561000', // 链接
                imgUrl: shareObj.imgUrl,
                success: function (res) {
                  // 分享成功执行此回调函数
                  alert('已分享');
                },
                cancel: function (res) {
                  alert('已取消');
                }
              });
//					          //
              wx.onMenuShareWeibo({
                title: shareObj.title,
                desc: shareObj.desc,
                link: shareObj.link, // 链接
                imgUrl: shareObj.imgUrl,
                success: function (res) {
                  // 分享成功执行此回调函数
                  alert('已分享');
                },
                cancel: function (res) {
                  alert('已取消');
                }
              });
              wx.onMenuShareQZone({
                title: shareObj.title,
                desc: shareObj.desc,
                link: hareObj.link, // 链接
                imgUrl: shareObj.imgUrl,
                success: function (res) {
                  // 分享成功执行此回调函数
                  alert('已分享');
                },
                cancel: function (res) {
                  alert('已取消');
                }
              });

            });

          }

        }
      });
    })

  })
</script>

<!--判断是否是微信端-->
<script>
  var browser = {
    versions: function () {
      var u = navigator.userAgent, app = navigator.appVersion;
      return {         //移动终端浏览器版本信息
        trident: u.indexOf('Trident') > -1, //IE内核
        presto: u.indexOf('Presto') > -1, //opera内核
        webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
        gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
        mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
        ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
        android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
        iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
        iPad: u.indexOf('iPad') > -1, //是否iPad
        webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
      };
    }(),
    language: (navigator.browserLanguage || navigator.language).toLowerCase()
  }
  if (browser.versions.mobile) {//判断是否是移动设备打开。browser代码在下面
    var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
      //在微信中打开
      $('.fenxain').hide();
//						$('#Qdu').hide()

    }
  } else {
    //否则就是PC浏览器打开
  }

</script>
</html>
